package com.lijing.service;

import com.lijing.dao.ClubDao;
import com.lijing.dao.UserDao;
import com.lijing.model.Club;
import com.lijing.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service(value = "ClubService")
public class ClubServiceImpl implements ClubService {

    @Autowired
    private ClubDao clubDao;
    @Autowired
    private UserDao userDao;

    @Override
    public void addClub(Club club) {
        clubDao.addClub(club);
    }

    @Override
    public Club getClub(Integer cid) {
        return clubDao.getClub(cid);
    }

    @Override
    public void updateClub(Club club) {
        clubDao.updateClub(club);
    }

    @Override
    public List<User> getMember(Integer cid) {
        return userDao.getUserList(cid);
    }

    @Override
    public List<Club> getClubList() {
        return clubDao.getClubList();
    }

    @Override
    public void deleteClub(Integer cid) {

    }

    @Override
    public Integer getMemberCount(Club club) {
        return clubDao.getMemberCount(club);
    }
}
